home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Misc / Wood.0.72 / Sources / PSWUControl.psw < prev    next >
Encoding:
Text File  |  1994-06-20  |  1.6 KB  |  86 lines

  1.  
  2. defineps PSWDrawControlPoints (float X,Y;float numstring Pts[TotPts];int TotPts;char *Chs)
  3.     X Y moveto  (Chs) Pts xyshow
  4. endps
  5.  
  6. defineps PSWDefineFont(char *fontname)
  7.     10 dict dup begin
  8.     /sa { % x y  sa  x' y'
  9.         transform
  10.         0.25 sub round 0.25 add exch
  11.         0.25 sub round 0.25 add exch
  12.         itransform
  13.     } bind def
  14.  
  15.     /rsa { %dx dy  rsa  dx' dy'
  16.         dtransform
  17.         round exch
  18.         round exch
  19.         idtransform
  20.     } bind def
  21.  
  22.     /FontName /fontname def
  23.     /FontType 3 def
  24.     /FontMatrix [.001 0 0 .001 0 0] def
  25.     /FontBBox [-500 -500 500 500] def
  26.  
  27.     /Encoding 256 array def
  28.         0 1 255 {Encoding exch /.notdef put} for
  29.     
  30.     Encoding (a) 0 get /Rectfill put
  31.     Encoding (b) 0 get /Rectopen put
  32.     Encoding (c) 0 get /Arcopen  put
  33.     Encoding (d) 0 get /Rombus   put
  34.     Encoding (e) 0 get /Partrect put
  35.     
  36.     /CharProcs 6 dict def
  37.     CharProcs begin
  38.         /.notdef { } def
  39.         /Rectfill
  40.         {
  41.             -300 -300 sa moveto 0 600 rsa rlineto
  42.             600 0 rsa rlineto 0 -600 rsa rlineto closepath
  43.             fill
  44.         } def
  45.         /Rectopen
  46.         {
  47.             -300 -300 sa moveto 0 600 rsa rlineto
  48.             600 0 rsa rlineto 0 -600 rsa rlineto closepath
  49.             stroke
  50.         } def
  51.         /Arcopen
  52.         {
  53.             0 0 450 0 360 arc
  54.                         -50 0 rmoveto 
  55.                         0 0 400 360 0 arcn 
  56.                         fill
  57.         } def
  58.         /Rombus
  59.         {
  60.             450 0 sa moveto 0 450 sa lineto
  61.             -450 0 sa lineto 0 -450 sa lineto
  62.             450 0 sa lineto   
  63.             fill
  64.         } def
  65.         /Partrect
  66.         {
  67.             -300 -300 sa moveto 0 500 rsa rlineto
  68.             500 0 rsa rlineto 0 -500 rsa rlineto closepath
  69.             fill
  70.         } def
  71.     end
  72.     
  73.     /BuildChar
  74.     {
  75.         500 0 -500 -500 500 500 setcachedevice
  76.         exch begin
  77.             Encoding exch get
  78.             CharProcs exch get
  79.             exec
  80.         end
  81.     } def
  82.   end
  83.   
  84.   /fontname exch definefont pop
  85. endps
  86.